<template>
<div id="menuComponent" :class="'menu'" >
  <el-menu
    default-active="2"
    class="el-menu-vertical-demo"
    background-color="#545c64"
    text-color="#fff"
   >
    <el-menu-item index="2">
      <i class="el-icon-menu"></i>
      <span slot="title"><router-link to="/admin" title="发布商品" >控制面板</router-link></span>
    </el-menu-item>
    <el-submenu index="1">
      <template slot="title">
        <i class="el-icon-location"></i>
        <span>商品管理</span>
      </template>
      <el-menu-item-group>
        <el-menu-item index="1-1" >
          <span  @click="changeComponent('goodsadd')" >发布商品</span>
        </el-menu-item>
        <el-menu-item index="1-2">
          <a href="/goodslist" title="商品列表" >商品列表</a>
          </el-menu-item>
      </el-menu-item-group>
    </el-submenu>
    <el-menu-item index="3">
      <i class="el-icon-setting"></i>
      <span slot="title">会员管理</span>
    </el-menu-item>
  </el-menu>
  </div>
</template>
<script>
export default {
  name: 'menuComponent',
  data () {
    return {
      msg: '菜单导航组件'
      // currentName: 'userManage',    //组件进行切换
    }
  },
  methods: {
    // changeComponent: function (name){
    //   return this.$store.state.userCurrentView;
    // }
  }
}
</script>
<style lang="less">
  #menuComponent a{
    box-sizing:border-box;
  }
</style>
